package HashMap的7种遍历方式;

import java.util.HashMap;
import java.util.Map;

public class Five {
    public static void main(String[] args) {
        Map<Integer, String> map = new HashMap<>();
        map.put(1,"Java");
        map.put(2,"C++");
        map.put(3,"C");
        map.put(4,"Python");
        map.put(5,"Golang");

        //遍历
        map.forEach((key, value) -> {
            System.out.println(key);
            System.out.println(value);
        });
    }
}
